package com.ruoyi.procurementmanagement.mapper;

import java.util.List;
import com.ruoyi.procurementmanagement.domain.ErpSupplierSettlement;
import org.apache.ibatis.annotations.Param;

/**
 * 供应商结算单Mapper接口
 *
 * @author ruoyi
 * @date 2025-03-20
 */
public interface ErpSupplierSettlementMapper
{
    /**
     * 查询供应商结算单
     *
     * @param id 供应商结算单主键
     * @return 供应商结算单
     */
    public ErpSupplierSettlement selectErpSupplierSettlementById(Long id);

    /**
     * 查询供应商结算单列表
     *
     * @param erpSupplierSettlement 供应商结算单
     * @return 供应商结算单集合
     */
    public List<ErpSupplierSettlement> selectErpSupplierSettlementList(ErpSupplierSettlement erpSupplierSettlement);

    /**
     * 新增供应商结算单
     *
     * @param erpSupplierSettlement 供应商结算单
     * @return 结果
     */
    public int insertErpSupplierSettlement(ErpSupplierSettlement erpSupplierSettlement);

    /**
     * 修改供应商结算单
     *
     * @param erpSupplierSettlement 供应商结算单
     * @return 结果
     */
    public int updateErpSupplierSettlement(ErpSupplierSettlement erpSupplierSettlement);

    /**
     * 删除供应商结算单
     *
     * @param id 供应商结算单主键
     * @return 结果
     */
    public int deleteErpSupplierSettlementById(Long id);

    /**
     * 批量删除供应商结算单
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteErpSupplierSettlementByIds(Long[] ids);

    /**
     * 获取结算单关联的入库单ID列表
     * @param settlementId 结算单ID
     * @return 入库单ID列表
     */
    List<Long> getSettlementEntryIds(Long settlementId);

    /**
     * 获取结算单关联的入库单ID列表
     */
    List<Long> selectEntryIdsBySettlementId(Long settlementId);


    /**
     * 添加结算单与入库单关联
     */
    int insertSettlementEntryRelation(@Param("settlementId") Long settlementId,
                                      @Param("entryId") Long entryId);

    /**
     * 删除结算单与入库单关联
     */
    int deleteSettlementEntryRelationBySettlementId(Long settlementId);
}
